#include "runner/base_runner.hpp"
#include "pusher/mjpeg_stream_server.hpp"
#include "buffer/shared_frame_buffer.hpp"

class MJPEGStreamServerRunner : public RunnerBase {
    public:
        MJPEGStreamServerRunner(MJPEGStreamServer &server, std::shared_ptr<SharedFrameBuffer> buffer)
            : RunnerBase("MJPEGStreamServer"), _server(server) {}
    
    protected:
        void Run() override {
            _server.Start();
            while (IsRunning()) {
                std::this_thread::sleep_for(std::chrono::milliseconds(100));
            }
            std::cout << "调用 MJPEGStreamServer stop函数" << std::endl;
            _server.Stop();
        }
    
    private:
        MJPEGStreamServer &_server;
        std::shared_ptr<SharedFrameBuffer> _buffer;
    };
    